package org.example.Contoller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
    //handler -> springmvc/hello return "hello"
    @RequestMapping("spring/hello")//对外访问的地址
    @ResponseBody  //直接返回到前端不用请求视图
    public String hello(){
        System.out.println("hello");
        return "hello";
    }
}
